package com.vdf.sisconsolid.report;

import java.util.HashMap;
import java.util.Map;

import org.apache.log4j.Logger;

import com.vdf.sisconsolid.util.SisconsolidProperties;

public class ConsolidationReport {

	private static Logger log = Logger.getLogger(ConsolidationReport.class);

	public static void generateConsolidationCard(Long idConsolidation,
			String civilStatus) {

		log.debug("generateConsolidationCard idConsolidation="
				+ idConsolidation);
		String jrxmlReportPath = SisconsolidProperties
				.getProperty(SisconsolidProperties.jrxmlReportPath);
		String jrxmlReport = "Consolidation";
		String pdfReportPath = SisconsolidProperties
				.getProperty(SisconsolidProperties.consolidationPdfArchivesPath);
		String pdfReport = idConsolidation.toString();
		Map<Object, Object> parameters = new HashMap<Object, Object>();
		parameters.put(ReportConstants.ID_CONSOLIDATION, idConsolidation);
		parameters.put(ReportConstants.IMAGES_PATH_KEY, SisconsolidProperties
				.getProperty(SisconsolidProperties.imagesPathValue));
		parameters.put(ReportConstants.CIVIL_STATUS, civilStatus);

		ReportGenerator.generateReportPDF(jrxmlReportPath, jrxmlReport,
				pdfReportPath, pdfReport, parameters);
	}

	public static void main(String[] args) {
		generateConsolidationCard(27L, "Solterito");
	}

}
